/*
 * @Author: bin.liu 2841208085@qq.com
 * @Date: 2025-10-02 15:58:29
 * @LastEditors: 刘斌 2841208085@qq.com
 * @LastEditTime: 2025-10-11 23:28:32
 * @FilePath: \MDK-ARMc:\WorkSpace\STM32\STM32F411\SmartMeter\smart-meter-project\04_Software\01_Source_Code\mcu\t1589\BOOT\BSP\W25Qxx\w25qxx_handler.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef W25QXX_HANDLER_H
#define W25QXX_HANDLER_H

#include "stdint.h"

typedef struct 
{
    uint8_t databuff[4096];
    uint16_t write_databuff_index;
    uint32_t write_index;
    uint8_t write_sector_index;//写入扇区索引        //4096
    uint32_t read_index;
    uint8_t read_sector_index;
}w25qxx_handler_t;

#define EXTERN_FLASH 


void W25Q64_Init(void);
uint8_t W25Q64_EraseChip(void);
uint8_t W25Q64_WriteData(uint8_t *data,uint32_t size);
uint8_t W25Q64_WriteDataEnd(void);
uint8_t W25Q64_ReadData(uint8_t *data,uint16_t *size);


#endif
